package cn.edu.scau.cmi.wujiaxian.exercise4;

public class Yanghuisanjiao {

	public static void main(String[] args) {
		yanghuisanjiao(50);
	}

	public static void yanghuisanjiao(int n) {
		double[] arr = new double[n + 1];
		for (int i = 0; i <= n; i++) {
			double t = 1, a;
			for (int j = 0; j <= i; j++) {
				if (j == 0 || j == i) {
					arr[j] = 1;
					System.out.print(1 + " ");
				} else {
					a = t;
					t = arr[j];
					arr[j] += a;
					System.out.print(Math.round(arr[j]) + " ");
				}
			}
			System.out.println();
		}
	}

}
